home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’96 / PredatorPrey / MainWindow.c < prev    next >
Text File  |  1996-06-22  |  2KB  |  109 lines

  1. /* MainWindow.c */    /*    C14 Calculator */
  2.  
  3. #include "MainWindow.h"
  4. #include "ResourceDefs.h"
  5. #include "WindowAids.h"
  6. #include "Miscellany.h"
  7.  
  8. void    MainWindowSeg()    {}
  9.  
  10. /*----------*/
  11. void OpenMainWindow        (Str255        fName,
  12.                          short        vRefNum,
  13.                          short        fRefNum)
  14. {
  15.     WindowPtr        newWindow;
  16.     Rect            bounds;
  17.  
  18.     newWindow = GetWindow (MainWindowID);
  19.     if (fName [0] != 0) {
  20.         SetWTitle (newWindow, fName);
  21.     }
  22.     SetPort (newWindow);
  23.     SetNewInfo (newWindow);
  24.     /*cur->vScroll = nil;*/
  25. /*    cur->hScroll = nil;*/
  26.     cur->fileNum    = fRefNum;
  27.     cur->volNum        = vRefNum;
  28.     cur->dirty        = false;
  29.     cur->filename    = NewString (fName);
  30.     cur->windowKind = WMainWindow;
  31.     ((WindowPeek) curWindow)->windowKind = userKind + WMainWindow;
  32.     cur->witlHandle = GetResource ('Witl', MainWindowID);
  33.     cur->wictHandle = GetResource ('Wict', MainWindowID);
  34.  
  35.     
  36.     cur->text = nil;
  37.  
  38.     ShowWindow (newWindow);
  39.  
  40. } /*OpenMainWindow*/
  41.  
  42. /*----------*/
  43. void CloseMainWindow    (void)
  44. {
  45.     
  46.     DisposHandle ((Handle) cur->filename);
  47.     DiscardInfo (curWindow);
  48. } /*CloseMainWindow*/
  49.  
  50. /*----------*/
  51. void ControlMainWindow  (ControlHandle        whichControl,
  52.                          short                whichPart,
  53.                          Point                where)
  54. {
  55.     Rect            bounds;
  56.  
  57.     
  58. } /*ControlMainWindow*/
  59.  
  60. /*----------*/
  61. void MouseInMainWindow    (Point        where,
  62.                          short        modifiers)
  63. {
  64.     Rect            bounds;
  65.  
  66.     
  67. } /*MouseInMainWindow*/
  68.  
  69. /*----------*/
  70. void TypeInMainWindow   (char        ch)
  71. {
  72.     if (cur->text == nil) {
  73.         SysBeep (1);
  74.     } else {
  75.         TEKey (ch, cur->text);
  76.         cur->dirty = true;
  77.     }
  78. } /*TypeInMainWindow*/
  79.  
  80. /*----------*/
  81. /*void UpdateMainWindow (void)*/
  82. /*{*/
  83. /*    Rect            bounds;*/
  84. /**/
  85. /*    */
  86. /*    DrawClippedGrow (-15, -15);*/
  87. /*} /*UpdateMainWindow*/
  88.  
  89. /*----------*/
  90. void ActivateMainWindow    (Boolean    activate)
  91. {
  92.     
  93.     DrawClippedGrow (-15, -15);
  94. } /*ActivateMainWindow*/
  95.  
  96. /*----------*/
  97. void ResizeMainWindow    (void)
  98. {
  99.     /* application-specific code to resize items in window */
  100. } /*ResizeMainWindow*/
  101.  
  102. /*----------*/
  103. pascal void ScrollMainWindow    (short        newValue,
  104.                                   short        oldValue)
  105. {
  106.     /* application-specific code to scroll window */
  107. } /*ScrollMainWindow*/
  108.  
  109. /* MainWindow */